<%--
  Created by IntelliJ IDEA.
  User: zhangyuan
  Date: 2020-03-20
  Time: 18:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>积分榜</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css?20190817.1">
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layui/layui/layui.js"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <script src="/lib/layui/layui/js/common.js?v=20190726" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/layui/layui/js/baseCode/base.js?v=2019080918:09" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div style="padding: 8px;">
    <%--<div style="text-align: right">
        <button type="button" class="layui-btn layui-btn-sm" name="thisforum">返回本讨论区</button>
        <button type="button" class="layui-btn layui-btn-sm" name="forum" >返回讨论区列表</button>
    </div>--%>
    <table id="demo" lay-filter="test"></table>
</div>
<script>
    // var boardId = $.GetRequest().boardId

    layui.use(['table','form'], function(){
        var table = layui.table;
        var form = layui.form;
        //第一个实例
        var tableIns= table.render({
            elem: '#demo'
            ,url: '/bbs/selTextNums' //数据接口
            // ,page: true //开启分页
            ,cols: [[ //表头
                {type: 'numbers', title: '排行', }
                ,{field: 'nickName', title: '昵称', }
                ,{field: 'trueName', title: '实名', }
                ,{field: 'textNums', title: '发表文章数', }
                ,{field: '积分', title: '积分',templet:function (d) {
                        return d.textNums*10
                    } }
            ]]
            ,parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code": 0, //解析接口状态
                    "data": res.obj //解析数据列表
                };
            }
        });
    });
    //返回本讨论区
    $("button[name='thisforum']").click(function(){
        window.location.href="/bbs/theme?boardId="+boardId;
    });
    //返回讨论区列表
    $("button[name='forum']").click(function(){
        window.location.href="/bbs/index";
    });
</script>
</body>
</html>
